<template>
	<view class="wrap">
		<!-- ref和show属性是一定要设置的 -->
		<!-- 先缩小再方法，再缩小 -->
		<uni-transition ref="one" mode-class="fade" custom-class="div1" v-bind:show="true">

		</uni-transition>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onLoad() {
			//调用动画函数
			setTimeout(() => {
				this.starAni();
			}, 100)
		},
		methods: {
			//创建动画函数
			starAni() {
				//必须确认ref对象获取成功
				//console.log(this.$refs.one);
				this.$refs.one.step({
					scale: 0.5
				}, {
					delay: 300
				})
				this.$refs.one.step({
					scale: 2.5
				}, {
					delay: 300,
					duration: 800
				})
				this.$refs.one.step({
					scale: 1
				})
				setTimeout(() => {
					uni.switchTab({
						url: '/pages/index/index'
					})
				}, 2500)
				this.$refs.one.run();
			},
		}
	}
</script>

<style lang="scss">
	.wrap {
		width: 100%;
		height: calc(93vh);
		display: flex;
		align-items: center;
		justify-content: center;

		.div1 {
			width: 100px;
			height: 100px;
			background-color: deepskyblue;
			border-radius: 6px;
		}

	}
</style>